package cn.jiedh.app.meiweidk.Utils.tool;

import android.graphics.Color;
import android.support.design.widget.Snackbar;
import android.view.View;
import android.widget.TextView;

import cn.jiedh.app.meiweidk.R;

/**
 * @name：SnackBar工具类
 * @author：司马林
 * @phone：18423134135
 * @createTime：2017/10/20
 */

public class SnackBarUtil {

    public static void showSnackBarShort(Snackbar snackbar) {
        View view = snackbar.getView();
        if (view != null) {
            view.setBackgroundColor(Color.parseColor("#fe706d"));
            TextView tv = (TextView) view.findViewById(R.id.snackbar_text);
            tv.setTextColor(Color.parseColor("#ffffff"));
            tv.setCompoundDrawablePadding(10);
            tv.setCompoundDrawablesWithIntrinsicBounds(R.mipmap.ts,0,0,0);
            snackbar.show();
        }
    }
}
